package com.vito.dcs.water.waterData.service.impl;

import java.util.*;
import org.springframework.beans.factory.annotation.*;

import com.vito.dcs.water.waterData.model.DataWaterBlenderModel;
import com.vito.dcs.water.waterData.service.DataWaterBlenderService;
import com.alibaba.dubbo.config.annotation.Service;
import com.vito.dcs.water.waterData.dao.DataWaterBlenderMapper;
import com.vito.base.model.DataGrid;
import com.vito.base.factory.IDFactory;

/**
 * DataWaterBlenderService接口实现类
 * @author  fangj E-mail: 
 * @version 0.1.1
 * @date    2019-4-12 14:14:03
 */
@Service
public class DataWaterBlenderServiceImpl implements DataWaterBlenderService {
	
	@Autowired
	private DataWaterBlenderMapper datawaterblenderMapper;
	
	@Override
	public int save(DataWaterBlenderModel datawaterblender){
		return datawaterblenderMapper.save(datawaterblender);
	}
	@Override
	public DataGrid<DataWaterBlenderModel> queryAllByPage(DataWaterBlenderModel datawaterblender){
		DataGrid<DataWaterBlenderModel> dg = new DataGrid<DataWaterBlenderModel>();
		dg.setRows(datawaterblenderMapper.queryAllByPage(datawaterblender));
		dg.setTotal(datawaterblender.getTotal());
		return dg;
	}
	@Override
	public DataWaterBlenderModel query(DataWaterBlenderModel datawaterblender){
		return datawaterblenderMapper.query(datawaterblender);
	}
	@Override
	public Integer update(DataWaterBlenderModel datawaterblender){
		return datawaterblenderMapper.update(datawaterblender);
	}
	
	@Override
	public Integer delete(DataWaterBlenderModel datawaterblender){
		return datawaterblenderMapper.delete(datawaterblender);
	}

    @Override
	public int saveDataWaterBlender(DataWaterBlenderModel datawaterblender){
	    datawaterblender.setId(IDFactory.getIDFactory().getIdInc()+"");                                                  
		return save(datawaterblender);
	}
}